<script>
import { getSetupContent } from '@/api/api.js'
export default {
	onLaunch: function () {
		// 检查缓存中是否已存在配置
		const cachedConfig = this.$cache.get('app_config');
		if (!cachedConfig) {
			// 缓存中不存在，才调用接口
			getSetupContent({
				appId: 'EDU',
				configKey: 'APP_CONFIG',
			}).then(res => {
				console.log('getAppConfig',res);
				this.$cache.set('app_config', res, 3600*24*30);
			})
		} else {
			console.log('app_config already cached, skip API call');
		}
	},
	onShow: function () {},
	onHide: function () {},
	methods: {}
};
</script>

<style lang="scss">
/*每个页面公共css */
@import '@/uni_modules/uview-ui/index.scss';
@import './app.css';
</style>
